package main

import (
  "fmt"
  "time"
)

func main() {

  // 获取当前时间（默认时区）
  currentTime := time.Now()
  fmt.Println("Current time (default timezone):", currentTime)

  // 设置时区为东8区
  location, err := time.LoadLocation("Asia/Shanghai")
  if err != nil {
    fmt.Println("Error loading location:", err)
    return
  }

  // 获取当前时间（东8区）
  currentTimePRC := currentTime.In(location)
  fmt.Println("Current time (PRC timezone):", currentTimePRC)

  currentTime = time.Now()
  fmt.Println("Current time (default timezone)1:", currentTime)
}
